PHP tester status / notes

Next

  • (will I ever?) Write tests for this library
  • Automatically run test/all dir, so no configuration is required
    • Better yet, scan the entire project (not vendor/) & run all test files. Then just cache the list of test files? phptest new to add new files or something
  • prompt for any configurations if needed

Latest

  • phptest -test TestName now ONLY runs the named test. You might be able to specify multiple -tests... but I haven't tested it.
  • Create Assertions trait to group assertions
  • fixed bug with a throw/catch not marking test as passed
  • Different location for config files allowed
  • Improved cli output
  • Added -test TestName option to cli invocation to display extended output of a single test in cli
  • Added Databasing trait to make some db operations a little easier.

todo

  • when run & no test dir is found, stop execution.
  • Refactor cli
  • Tests
  • A real name
  • additional compare/assert functions like "does file exist"
    • Many of these could be just an array. Like ['assertFileExists'=>'is_file']. __call($method,$args){$func=$this->func[$method]; return $func(...$args);}
      • Basically a true/false is required to be returned from the callable. This would just make it really easy to define a bunch of really simple assertions.
      • I could also do var-inspection (like, test failed is_file(...$args) returned false. ...$args === [some_array])
      • I could do ['assertFileExists'=>['is_string', 'file_exists','is_file']] & it only does the 2nd callable if the 1st one passes. (i like this a lot)

Ideas/thoughts

  • An Assertions extensibility engine. So new assertions can be added easily by anyone, including project-specific assertions.